﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PMSSys
{
    public partial class InitialClinicalDataView : Form
    {
        public InitialClinicalDataView()
        {
            InitializeComponent();
        }
        private bool isModified = false;
        private bool addMode = false;
        private void closeLogic(object sender, EventArgs e)
        {
            this.Close();

        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            isModified = true;
        }

        private void iHOthersheckbox_CheckedChanged(object sender, EventArgs e)
        {
            iHOtherstextBox.Enabled = iHOthersheckbox.Checked;
            if (!iHOthersheckbox.Checked)
                iHOtherstextBox.Clear();
            checkBox1_CheckedChanged(sender, e);
        }

        private void cancerCheckbox(object sender, EventArgs e)
        {
            textBox3.Enabled = checkBox10.Checked;
            if (!checkBox10.Checked)
                textBox3.Clear();
            checkBox1_CheckedChanged(sender, e);
        }

        private void anemiaCheckbox(object sender, EventArgs e)
        {
            textBox4.Enabled = checkBox13.Checked;
            if (!checkBox13.Checked)
                textBox4.Clear();
            checkBox1_CheckedChanged(sender, e);
        }

        private void checkBox14_CheckedChanged(object sender, EventArgs e)
        {
            textBox5.Enabled = checkBox14.Checked;
            if (!checkBox14.Checked)
                textBox5.Clear();
            checkBox1_CheckedChanged(sender, e);
        }

        private void checkBox15_CheckedChanged(object sender, EventArgs e)
        {
            textBox6.Enabled = checkBox15.Checked;
            if (!checkBox15.Checked)
                textBox6.Clear();
            checkBox1_CheckedChanged(sender, e);
        }

        private void checkBox16_CheckedChanged(object sender, EventArgs e)
        {
            textBox7.Enabled = checkBox16.Checked;
            if (!checkBox16.Checked)
                textBox7.Clear();
            checkBox1_CheckedChanged(sender, e);
        }

        private void checkBox17_CheckedChanged(object sender, EventArgs e)
        {
            textBox8.Enabled = checkBox17.Checked;
            if (!checkBox17.Checked)
                textBox8.Clear();
            checkBox1_CheckedChanged(sender, e);
        }

        private void checkBox18_CheckedChanged(object sender, EventArgs e)
        {
            richTextBox4.Enabled = checkBox18.Checked;
            if (!checkBox18.Checked)
                richTextBox4.Clear();
            checkBox1_CheckedChanged(sender, e);
        }

        private void radioButton2_CheckedChanged(object sender, EventArgs e)
        {
            textBox18.Enabled = radioButton2.Checked;
            textBox19.Enabled = radioButton2.Checked;

            if (!radioButton2.Checked)
            {
                textBox18.Clear();
                textBox19.Clear();
            }
            checkBox1_CheckedChanged(sender, e);
        }

        private void checkBox24_CheckedChanged(object sender, EventArgs e)
        {
            textBox20.Enabled = checkBox24.Checked;
            if (!checkBox24.Checked)
                textBox20.Clear();
            checkBox1_CheckedChanged(sender, e);
        }

        private void checkBox26_CheckedChanged(object sender, EventArgs e)
        {
            textBox21.Enabled = checkBox26.Checked;
            if (!checkBox26.Checked)
                textBox21.Clear();
            checkBox1_CheckedChanged(sender, e);
        }

        private void radioButton3_CheckedChanged(object sender, EventArgs e)
        {
            textBox24.Enabled = radioButton3.Checked;
            if (!radioButton3.Checked)
            {
                textBox24.Clear();
            }
            checkBox1_CheckedChanged(sender, e);
        }

        private void radioButton5_CheckedChanged(object sender, EventArgs e)
        {
            textBox23.Enabled = radioButton5.Checked;
            if (!radioButton5.Checked)
            {
                textBox23.Clear();
            }
            checkBox1_CheckedChanged(sender, e);
        }

        private void radioButton7_CheckedChanged(object sender, EventArgs e)
        {
            textBox25.Enabled = radioButton7.Checked;
            if (!radioButton7.Checked)
            {
                textBox25.Clear();
            }
            checkBox1_CheckedChanged(sender, e);
        }

        private void radioButton9_CheckedChanged(object sender, EventArgs e)
        {
            textBox26.Enabled = radioButton9.Checked;
            if (!radioButton9.Checked)
            {
                textBox26.Clear();
            }
            checkBox1_CheckedChanged(sender, e);
        }

        private void radioButton11_CheckedChanged(object sender, EventArgs e)
        {
            richTextBox5.Enabled = radioButton11.Checked;
            if (!radioButton11.Checked)
            {
                richTextBox5.Clear();
            }
            checkBox1_CheckedChanged(sender, e);
        }

        private void radioButton13_CheckedChanged(object sender, EventArgs e)
        {
            textBox27.Enabled = radioButton13.Checked;
            if (!radioButton13.Checked)
            {
                textBox27.Clear();
            }
            checkBox1_CheckedChanged(sender, e);
        }

        private void checkBox40_CheckedChanged(object sender, EventArgs e)
        {
            textBox41.Enabled = checkBox40.Checked;
            if (!checkBox40.Checked)
                textBox41.Clear();
            checkBox1_CheckedChanged(sender, e);
        }

        private void checkBox39_CheckedChanged(object sender, EventArgs e)
        {
            textBox42.Enabled = checkBox39.Checked;
            if (!checkBox39.Checked)
                textBox42.Clear();
            checkBox1_CheckedChanged(sender, e);
        }

        private void checkBox38_CheckedChanged(object sender, EventArgs e)
        {
            textBox43.Enabled = checkBox38.Checked;
            if (!checkBox38.Checked)
                textBox43.Clear();
            checkBox1_CheckedChanged(sender, e);
        }

        private void checkBox41_CheckedChanged(object sender, EventArgs e)
        {
            textBox44.Enabled = checkBox41.Checked;
            if (!checkBox41.Checked)
                textBox44.Clear();
            checkBox1_CheckedChanged(sender, e);
        }

        private void checkBox42_CheckedChanged(object sender, EventArgs e)
        {
            textBox45.Enabled = checkBox42.Checked;
            if (!checkBox42.Checked)
                textBox45.Clear();
            checkBox1_CheckedChanged(sender, e);
        }

        private void checkBox43_CheckedChanged(object sender, EventArgs e)
        {
            textBox46.Enabled = checkBox43.Checked;
            if (!checkBox43.Checked)
                textBox46.Clear();
            checkBox1_CheckedChanged(sender, e);
        }

        private void checkBox44_CheckedChanged(object sender, EventArgs e)
        {
            textBox47.Enabled = checkBox44.Checked;
            textBox48.Enabled = checkBox44.Checked;
            textBox49.Enabled = checkBox44.Checked;
            textBox50.Enabled = checkBox44.Checked;
            textBox51.Enabled = checkBox44.Checked;
            textBox52.Enabled = checkBox44.Checked;
            textBox53.Enabled = checkBox44.Checked;
            textBox54.Enabled = checkBox44.Checked;
            if (!checkBox44.Checked)
            {
                textBox47.Clear();
                textBox48.Clear();
                textBox49.Clear();
                textBox50.Clear();
                textBox51.Clear();
                textBox52.Clear();
                textBox53.Clear();
                textBox54.Clear();
            }
            checkBox1_CheckedChanged(sender, e);
        }

        private void checkBox45_CheckedChanged(object sender, EventArgs e)
        {
            textBox55.Enabled = checkBox45.Checked;
            textBox56.Enabled = checkBox45.Checked;
            textBox57.Enabled = checkBox45.Checked;
            textBox58.Enabled = checkBox45.Checked;
            textBox59.Enabled = checkBox45.Checked;
            if (!checkBox45.Checked)
            {
                textBox55.Clear();
                textBox56.Clear();
                textBox57.Clear();
                textBox58.Clear();
                textBox59.Clear();
            }
            checkBox1_CheckedChanged(sender, e);
        }

        private void InitialClinicalDataView_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (isModified)
            {
                DialogResult res = uiUtility.confirmSaveDialog();
                if (res != DialogResult.Cancel)
                {
                    if (res == DialogResult.Yes)
                    {
                        if (addMode)
                        {
                        }
                        else
                        {
                        }
                    }

                }
                else
                    e.Cancel = true;
            }
        }

        private void InitialClinicalDataView_Load(object sender, EventArgs e)
        {
            ToolTip t1 = uiUtility.tooltips();
            t1.SetToolTip(this.button6, "Back");
        }


    }
}
